import re
import datetime
from dateutil import relativedelta as rdelta

def is_date_valid(date):
    res = {'valid': False, 'comment': []}
    try:
        birthday = datetime.datetime.strptime(date, '%Y-%m-%d')
        today = datetime.datetime.now()
        delta = rdelta.relativedelta(today, birthday)
        if delta.years < 18:
            res['comment'].append('Customer age is less than 18.')
        elif delta.years > 80:
            res['comment'].append('Customer age is greater than 80.')
        else:
            res['valid'] = True
        return res
    except ValueError:
        res['comment'].append('Valid date format is YYYY-MM-DD.')
        return res


# print(is_date_valid('1900-sd-01'))
teststr = '99f9k9'
res = re.match('\d+', teststr)

if res and len(teststr) <= 5:
    print(res)
else:
    print('end')
